package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
	/**
	 * 根据openid获得用户消息
	 * @param openid
	 * @return
	 */
	@Select("select * from user where openid=#{openid}")
	User getByOpenid(String openid);

	/**
	 * 注册微信用户
	 * @param user
	 */

	void insert(User user);

	/**
	 * 根据id获得用户消息
	 * @param id
	 * @return
	 */
	@Select("select * from user where id=#{id}")
	User getById(Long id);


	Integer countByMap(Map map);
}
